package com.jiawa.train.business.controller.web;

import com.jiawa.train.business.req.DailyTrainTicketQueryReq;
import com.jiawa.train.business.service.DailyTrainTicketService;
import com.jiawa.train.common.resp.PageResult;
import com.jiawa.train.common.resp.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController()
@RequestMapping("/web/dailyTrainTicket")

public class DailyTrainTicketController {
    @Resource
    private DailyTrainTicketService dailyTrainTicketService;

    //查询缓存数据
//    @GetMapping("/page")
//    public Result<PageResult> queryDailyTrainTicketList(DailyTrainTicketQueryReq  req) {
//        PageResult pageResult = dailyTrainTicketService.queryDailyTrainTicketList(req);
//        return Result.success(pageResult);
//    }

    //查询数据库，将数据存入缓存中
    @GetMapping("/page")
    public Result<PageResult> queryDailyTrainTicketList2(DailyTrainTicketQueryReq  req) {
        PageResult pageResult = dailyTrainTicketService.queryDailyTrainTicketList(req);
        return Result.success(pageResult);
    }
}
